FROM centos:latest
RUN yum install -y perl
RUN yum install -y net-tools
RUN yum install -y libaio
RUN yum install -y numactl
RUN yum install -y initscripts
RUN mkdir -p /data/soft/mysql
RUN mkdir -p /data/shell/init
RUN touch /data/shell/init/test.text
COPY soft/mysql-community-common-5.7.10-1.el6.x86_64.rpm  /data/soft/mysql/mysql-community-common-5.7.10-1.el6.x86_64.rpm
COPY soft/mysql-community-libs-5.7.10-1.el6.x86_64.rpm /data/soft/mysql/mysql-community-libs-5.7.10-1.el6.x86_64.rpm
COPY soft/mysql-community-client-5.7.10-1.el6.x86_64.rpm /data/soft/mysql/mysql-community-client-5.7.10-1.el6.x86_64.rpm
COPY soft/mysql-community-devel-5.7.10-1.el6.x86_64.rpm /data/soft/mysql/mysql-community-devel-5.7.10-1.el6.x86_64.rpm
COPY soft/mysql-community-server-5.7.10-1.el6.x86_64.rpm /data/soft/mysql/mysql-community-server-5.7.10-1.el6.x86_64.rpm

RUN rpm -ivh /data/soft/mysql/mysql-community-common-5.7.10-1.el6.x86_64.rpm
RUN rpm -ivh /data/soft/mysql/mysql-community-libs-5.7.10-1.el6.x86_64.rpm
RUN rpm -ivh /data/soft/mysql/mysql-community-client-5.7.10-1.el6.x86_64.rpm
RUN rpm -ivh /data/soft/mysql/mysql-community-devel-5.7.10-1.el6.x86_64.rpm
RUN rpm -ivh /data/soft/mysql/mysql-community-server-5.7.10-1.el6.x86_64.rpm
# Define mysql environment variables.
ENV MYSQL_DATA /var/lib/mysql
ENV MYSQL_LOG /var/log/mysql
ENV MYSQL_CNF_CONTENT ""
#RUN echo "${MYSQL_CNF_CONTENT}" > /etc/my.cnf
VOLUME ["/var/lib/mysql", "/var/log/mysql"]
COPY mysql_init.sh /mysql_init.sh
ENTRYPOINT ["/mysql_init.sh"]
#open mysql port
EXPOSE 3306
CMD ["-D"]
